package ru.sh.jewel;

import framework.GameResources;
import framework.graphics.ScaledAnimation;
import framework.graphics.Texture;
import framework.managers.TextureManager;
import framework.objects.hero.Hero;


public class NeedJewel extends Jewel {	

	private boolean getted = false;
	
	public NeedJewel(float x, Hero hero) {
		super(x, hero);
		type = Jewel.NEED_TYPE;
	}

	@Override
	public void onRemove() {
		if (!getted) {
			hero.downHealth(1);
		}
	}

	@Override
	public void onGet() {
		getted = true;
		super.onGet();
	}

	@Override
	protected void initPresentation() {
//		presentation = TextureManager.getTexture(SHResourcesInfo.getBitmapName(8));
		presentation = new ScaledAnimation(100, new Texture[] {TextureManager.getTexture(GameResources.getBitmapName(8))},
				0.5f, 2, 1, 
				0.5f, 2, 1);
	}

}
